<!DOCTYPE html>
<html lang="en">
    <head>
        {include file="public/meta" /}
        {include file="public/link" /}
        {include file="public/form" /}
    </head>
    <body data-type="index" class="theme-white">
        <div class="am-g tpl-g">
            {include file="public/header" /}
            {include file="public/left" /}
            {include file="public/content_top" /}
            <ol class="am-breadcrumb" style="    margin-bottom: 0;">
                <li><a href="../home/index.html" class="am-icon-home">首页</a></li>
            </ol>
            <div class="widget am-cf">
                <form class="am-cf" id="form" onsubmit="return false">
                    <div class="am-panel am-panel-primary">
                        <div class="am-panel-hd">基础信息</div>
                        <div class="am-panel-bd">
                            <div class="am-form-group">
                                <span class="s1">所属代理：</span>
                                <label class="am-form-label">
                                    <select name="aid" title="" class="am-form-field am-input-sm">
                                        {foreach $agent as $val}
                                        <option value="{$val['id']}">{$val.name}</option>
                                        {/foreach}
                                    </select>
                                </label>
                            </div>
                            <div class="am-form-group">
                                <span class="s1">员工编号：</span>
                                <label class="am-form-label">
                                    <input type="text" id="num_name" class="am-form-field am-input-sm" name="num_name" value="" placeholder="请输入员工编号"/>
                                </label>
                            </div>
                            <div class="am-form-group">
                                <span class="s1">登录密码：</span>
                                <label class="am-form-label">
                                    <input type="password" id="password" class="am-form-field am-input-sm" name="password" value="" placeholder="请输入登录密码"/>
                                </label>
                            </div>
                            <div class="am-form-group">
                                <span class="s1">名称：</span>
                                <label class="am-form-label">
                                    <input type="text" id="name" class="am-form-field am-input-sm" name="name" value="" placeholder="请输入名称"/>
                                </label>
                            </div>
                            <div class="am-form-group">
                                <span class="s1">员工状态：</span>
                                <label class="am-form-label">
                                    <select name="status" title="" class="am-form-field am-input-sm">
                                        <option value="">请选择</option>
                                        <option value="1">正常</option>
                                        <option value="0">锁定</option>
                                    </select>
                                </label>
                            </div>
                            <div class="am-form-group">
                                <span class="s1">提现银行卡号：</span>
                                <label class="am-form-label">
                                    <input type="text" id="bank" class="am-form-field am-input-sm" name="bank" value="" placeholder="请输入银行卡号"/>
                                </label>
                            </div>
                            <div class="am-form-group">
                                <span class="s1">提现状态：</span>
                                <label class="am-form-label">
                                    <select name="bank_status" title="" class="am-form-field am-input-sm">
                                        <option value="">请选择</option>
                                        <option value="1">允许</option>
                                        <option value="0">禁止</option>
                                    </select>
                                </label>
                                <span class="s2">*是否禁止该员工提现</span>
                            </div>
                            <div class="am-form-group">
                                <span class="s1">联系人姓名：</span>
                                <label class="am-form-label">
                                    <input type="text" id="cont_name" class="am-form-field am-input-sm" name="cont_name" value="" placeholder="请输入联系人姓名"/>
                                </label>
                            </div>
                            <div class="am-form-group">
                                <span class="s1">联系人电话：</span>
                                <label class="am-form-label">
                                    <input type="text" id="cont_phone" class="am-form-field am-input-sm" name="cont_phone" value="" placeholder="请输入联系人电话"/>
                                </label>
                            </div>
                            <div class="am-form-group">
                                <span class="s1">保证金：</span>
                                <label class="am-form-label">
                                    <input type="text" id="bond" class="am-form-field am-input-sm" name="bond" value="" placeholder="请输入保证金"/>
                                </label>
                                <span class="s2">*不允许提现</span>
                            </div>
                            <div class="am-form-group">
                                <span class="s1">手续费提成比例：</span>
                                <label class="am-form-label">
                                    <input type="text" id="com_fee" class="am-form-field am-input-sm" name="com_fee" value="" placeholder="请输入手续费提成比例"/>
                                </label>
                                <span class="s2">1=100%</span>
                            </div>
                            <div class="am-form-group">
                                <span class="s1">递延费提成比例：</span>
                                <label class="am-form-label">
                                    <input type="text" id="defer_ratio" class="am-form-field am-input-sm" name="defer_ratio" value="" placeholder="请输入递延费提成比例"/>
                                </label>
                                <span class="s2">1=100%</span>
                            </div>
                            <div class="am-form-group">
                                <span class="s1">备注：</span>
                                <label class="am-form-label">
                                    <input type="text" id="desc" class="am-form-field am-input-sm" name="desc" value="" placeholder="请输入备注"/>
                                </label>
                            </div>
                            <div class="am-panel-bd" style="padding-bottom: 1rem;margin-left: 13rem">
                                <button type="submit" class="am-btn am-btn-primary am-btn-sm" onclick="sub()">确定</button>
                                <a href="index.html" class="am-btn am-btn-secondary am-btn-sm">返回</a>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        {include file="public/foot" /}
        <script type="text/javascript" src="/static/ajaxupload.js"></script>
        <script>


        </script>
        <script type="text/javascript">
            $(function () {
            var nav = $('.left-sidebar li.sidebar-nav-link');
            nav.removeClass("active");
            nav.eq(6).find('ul').show();
            // nav.eq(3).find('ul li').eq(0).find('a').addClass('active');

            });
            function sub() {
            var arr = parseFormJson("#form");
            $.ajax({
            url: "{:url('Agents/add_staff')}",
                    data: {arr: arr},
                    type: "post",
                    success: function (r) {
                    if (r['code'] == 1) {
                    alert_open(r['msg'])
                    } else {
                    alert_msg(r['msg']);
                    }
                    }
            });
            }
        </script>
    </body>
</html>